package TestController;

import static org.junit.Assert.*;
import org.junit.Test;
import Task28.Controller;

public class TestGetAbsPath {
	Controller tester = new Controller();


	
	@Test
	public void test() {
		String sResult=tester.getAbsPath("C:\\TEST1","C:\\");
		assertEquals("C:\\", sResult);
	}
	
	@Test
	public void test2() {
		String sResult=tester.getAbsPath("C:\\TEST1", "");
		assertEquals("C:\\TEST1\\", sResult);
	}
	
	@Test
	public void test3() {
		String sResult=tester.getAbsPath("C:\\TEST1", "23"); //exist
		assertEquals("C:\\TEST1\\23", sResult);
	}
	
	@Test
	public void test3_2() {
		String sResult=tester.getAbsPath("C:\\TEST1", "223"); //not exist
		assertEquals("C:\\TEST1\\223", sResult);
	}
	
	@Test
	public void test4() {
		String sResult=tester.getAbsPath("C:\\TEST1", "C:\\TEST1");
		assertEquals("C:\\TEST1", sResult);
	}
	
	@Test
	public void test5() {
		String sResult=tester.getAbsPath("C:\\TEST1", "C:\\TEST1\\23");
		assertEquals("C:\\TEST1\\23", sResult);
	}
	
	@Test
	public void test6() {
		String sResult=tester.getAbsPath("C:\\TEST1", "E:\\TEST1\\111");
		assertEquals("E:\\TEST1\\111", sResult);
	}
	
	@Test
	public void test7() {
		String sResult=tester.getAbsPath("E:\\TEST1", "C:\\TEST1\\23");
		assertEquals("C:\\TEST1\\23", sResult);
	}
}
